/**
* @author Meng Zhang
**/

#include "stdafx.h"
#include "TextBuffer.h"
#include "../mfc/resource.h"

TextBuffer::TextBuffer( int _docId , const TCHAR *_pathFileName ) : docId(_docId)  , pathFilename(_pathFileName) , isDirty(false) {
	/*file.Open(_pathFileName , CFile::modeNoTruncate | CFile::modeCreate);
	CString content;
	file.ReadString(content);*/
	//TextBufferFactory::Instance()->SetBufferContent(_docId , content.GetString() , content.GetLength());
	//BufferController::Instance()->LoadFile(*this);
}

TextBuffer::~TextBuffer() {
	//TextBufferFactory::Instance()->ReleaseBuffer(this);
	WriteLog("Doc %d is destoryed",docId);
}

//simple return
//TODO(wsxiaoys)
std::string TextBuffer::GetProjectPath() {
	return (LPCSTR)CT2CA(pathFilename.GetString());
}